package com.jch.demo.aop;

import com.jch.demo.aop.beans.ArithmeticCalculator;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestMain {

    public static void main(String[] args) {
        ApplicationContext ctx = new ClassPathXmlApplicationContext("/beans/beans-demo.xml");
        ArithmeticCalculator calculator = ctx.getBean(ArithmeticCalculator.class);
        double result = calculator.add(1,1);
        System.out.println(result);
        result = calculator.div(10,0);
        System.out.println(result);
    }

}
